/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.jhelper.unit06.demo;

import java.util.Hashtable;

/**
 *
 * @author Administrator
 * 参数
 */
public class BookDemo {
    
    public static void main(String[] args) {
    
        Hashtable s = new Hashtable();
        BookBean tmp = null;
        
        s.put("isbn001", new BookBean("isbn001", "红楼梦", "曹雪芹", "人民文学出版社", 100));
        s.put("isbn002", new BookBean("isbn002", "西游记", "吴承恩", "人民文学出版社", 100));
        s.put("isbn003", new BookBean("isbn003", "水浒传", "施耐庵", "人民文学出版社", 100));
        s.put("isbn004", new BookBean("isbn004", "三国演义", "罗贯中", "人民文学出版社", 100));
        s.put("isbn005", new BookBean("isbn005", "喻世明言", "冯梦龙", "人民文学出版社", 100));
                
        System.out.println(s);
     
        
        
        String key = "isbn002";
        if(s.containsKey(key)){
            tmp = (BookBean) s.get(key);
            System.out.println("name: "+tmp.getName());
            System.out.println("author: "+tmp.getAuthor());
            System.out.println("publisher: "+tmp.getPublisher());
            System.out.println("price: "+tmp.getPrice());
            
        }else{
            System.out.println("查无此书!");
        }
        
    }
    
    
    

}
